$(document).ready(function(){
	$("#nmFigli").text($("#numeroFigli").val());
	
	 $(".date").datepicker({
		 showOn: "button",
		 yearRange: "-70:+0",
		 buttonImage: "images/glyphicons_045_calendar.png",
		 buttonImageOnly: true,
		 showButtonPanel: true,
		 changeMonth: true,
		 changeYear: true
	 });
	 
	 $("#nmFigli").spinner({
		min : 1,
		max : 60,
		step : 1,
		spin: function( event, ui ) {
			$("#nmFigli").text(ui.value);
			$("#numeroFigli").val($("#nmFigli").html());
		},
	 	start: function(event, ui){
	 		$("#nmFigli").text($("#numeroFigli").val());
	 	},
		change: function( event, ui ) {
			$("#numeroFigli").val($("#nmFigli").html());
		}
	 });
	 
	 $("#nonHaFigli").click(function(){
		 $("#nmFigli").text("");
		 $("#numeroFigli").val("");
	 });
	 
});